package com.xiaomai.staservice.controller;


import com.xiaomai.commonutil.R;
import com.xiaomai.staservice.service.StatisticsDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-10-25
 */
@RestController
@RequestMapping("/staservice/statisticsdaily")

public class StatisticsDailyController {

    @Autowired
    private StatisticsDailyService staService;

    @PostMapping("registerCount/{day}")
    public R registerCount(@PathVariable String day){
        staService.registerCount(day);
        return  R.ok();
    }
    @PostMapping("showData/{type}/{begin}/{end}")
    private R showData(@PathVariable String type,@PathVariable String begin,@PathVariable String end){
      Map<String,Object> map = staService.getChartData(type,begin,end);
      return R.ok().data(map);
    }




}

